home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
M-More Monthly Disks
/
(c)m4.d64
/
plane lander.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
204 lines
1 REM ******** AIRCRAFT LANDER *********
2 REM ******** D.HALL 1/11/82 *********
4 POKE53280,15:POKE53281,15:RC=32
5 UF=0:U=1:ZZ=0:Z=1:M=20:CC=54272:AC=1979:CU=56251:CB=1971:CE=56243:PV=1024
10 A$=""
15 DN$="":CL$=" [157][157][157][157][157]"
20 D1$=DN$+""
25 B$=A$+"[157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
30 SQ(0)=108:SQ(1)=123:SQ(2)=124:SQ(3)=126:IFQT=1THEN50
32 GOSUB12000
35 PRINT"PRESS F 1 FOR INSTRUCTIONS,"
36 PRINT"OR ANY OTHER KEY TO BEGIN."
40 GETR$:IFR$=""THEN40
45 IFR$="[133]"THENGOSUB10000
50 PRINT"[147][163][210]
55 [153]" ASC
60 PRINT" [192]
65 [153]" STR$TO
70 PRINT" [198]
75 [153]" STR$TO
80 PRINT" [196][210]
85 [153]" STR$ASC
90 PRINT" [163][195][210]
100 [153]" VALLENASCTO
110 PRINT" [197][195][198][164]
120 [153]" TAB(VALSTR$LENTANASC(null)TOTO
130 PRINT" [152][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][168]^[168][168][168][168][166]";
135 PRINT"[185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]";
140 PRINT"[181]* * * * * INSTRUMENT PANEL * * * * *[182][146]";
145 PRINT"[188][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][146][190]";
200 FA=0:H=1900:AS=150:AG=0:EF=1:EP=3000
220 GOSUB5000
240 GOSUB2000:AG=AG+AF
241 IFSA=1THENXD=XD+1:IFXD>7THEN243
242 IFAS>120ANDSA=1THENSA=0:XD=0
243 IFSA=1THENPRINTD1$"YOU ARE STALLING [146][145]"
245 EP=EP+(EF*341):IFEP>10000THENEP=10000
246 IFEP<0THENEP=0
247 IFUF=1ANDSA=1THENUF=0:Z2=1
248 IFZZ=1ANDSA=1THENZZ=0:Z1=1
249 TF=1.5*((EP*2)/AS-20+(UF=1)*20+(ZZ=1)*175-(FA*3)-19*SIN(AG*(null)/180)*M)
250 IFZ2=1THENUF=1:Z2=0
251 IFZ1=1THENZZ=1:Z1=0
252 AS=AS+INT(10*TF/M)/10
253 IFAS<=1THENH=H-(T*22):AS=1:SA=1
260 HD=HD+INT(COS(AG*(null)/180)*AS+.5)
280 IFABS(AG)>9THENL=(1/(ABS(AG)-9)):GOTO302
285 IFSA=1THENAS=AS+INT(10*TF/M)/10:GOTO302
300 L=1-(COS(AG*(null)/6))*AS/150
302 IFAS<92THENSA=1:GOTO325
304 IFAS<110AND(FA=0ORU=1)THENSA=1
320 IFAS>185ANDFA>0ANDAS<210THENPRINTD1$"SPEED TO GREAT FOR FLAPS![145]"
322 IFAS>177ANDFA>0ANDW<>1THENL=L*(FA*2)
325 IFC=1ORC=2THENFORI=1905TO1920:POKEI,32:NEXT
326 IFC=2THEN360
335 IFAS>210ANDFA>0THENC=1
340 IFC=1THENPRINTD1$"FLAPS AND WINGS TORN OFF! [145]":W=1
360 IFC=1ORC=2THENAG=AG-5
365 IFSA=1THENGOSUB6000:GOTO400
380 L=L+(SIN(FA*(null)/180))*(45*(1-SIN(AS*(null)/180)))
400 H=H+INT((AS*SIN(AG*(null)/180)+L*COS(AG*(null)/180)))
420 GOSUB5200
425 IFH>1900THENPOKEPV,32:GOTO644
430 IFHD>33970THEN7105
440 X=HD/900:Y=((1950-H)/150)
460 IFINT(X)=INT(X+.5)THENX=INT(X):GOTO500
480 X=INT(X)+.5
500 IFINT(Y)=INT(Y+.5)THENY=INT(Y):GOTO540
520 Y=INT(Y)+.5
540 QS=0:IFX=INT(X)THENQS=QS+1
560 IFY=INT(Y)THENQS=QS+2
580 POKEPV,RC:POKEPV+CC,CX
600 PV=1024+(INT(X))+INT(Y)*40
620 RC=PEEK(PV):CX=PEEK(PV+CC)
625 IFH<0THEN6100
640 POKEPV,SQ(QS):POKEPV+CC,0
644 IFUF=0THENU=1:POKECB,32:POKECB+2,32:POKECB+4,32:POKECE,3:POKECE+2,3:POKECE+4,3
645 IFUF=1THENU=-1:POKECB,81:POKECB+2,81:POKECB+4,81:POKECE,5:POKECE+2,5:POKECE+4,5
650 IFZZ=0THENZ=1:POKEAC,32:POKECU,0
651 IFZZ=1THENZ=-1:POKEAC,42:POKECU,1
652 IFAS>225ANDAS<250THENPRINTD1$"[150]DANGER!! AIR SPEED TO HIGH.[145]"
653 IFAS>250THENW=1:PRINTD1$"PLANE HAS JUST LOST WINGS!![145]":C=2
660 GOTO240
2000 REM** INPUTS **
2010 GETR$:IFR$=""THENRETURN
2020 IFR$="I"THENEF=1
2025 IFR$="H"THENEF=0
2030 IFR$="D"THENEF=-1
2050 IFR$="U"THENUF=UF+U
2060 IFASC(R$)<56ANDASC(R$)>47THENFA=5*VAL(R$)
2065 IFR$="-"THENAF=-1
2070 IFR$="+"THENAF=1
2075 IFR$="="THENAF=0
2076 IFR$="A"THENZZ=ZZ+Z
2080 RETURN
5000 PRINT"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]END OF"
5010 PRINT"[221]AIR SPEED[221]RUN. DIST. HEIGHT"
5020 PRINT"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
5030 PRINT"[221]ANGLE [221]"
5040 PRINT"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
5050 PRINT"[221]ENG.REVS [221] FLAPS U/CARR. A/B."
5060 PRINT"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
5100 RETURN
5200 AS=INT(AS+.5)
5201 IFH<6ANDH>-10THENH=0
5202 PRINTDN$:PRINTTAB(11)CL$AS
5205 PRINTTAB(20)" [157][157][157][157][157][157]"33965-HDTAB(32)CL$H
5210 PRINTTAB(11)" [157][157][157][157][157][157]"CL$AG+1
5215 IFC=1ORC=2THENPRINT" NO ENGINES!!!! ":GOTO5230
5220 PRINT""TAB(11)" [157][157][157][157][157][157]"EP
5230 PRINTTAB(21)CL$FA
5235 FORI=1984TO2023:POKEI,32:NEXT
5250 RETURN
6000 AG=AG-3-AF
6002 IFAG>0THENAG=INT(AG/XD+1))
6005 H=INT(H+AS*(SIN(AG*(null)/180))-9.5)
6010 AS=AS+((AG<0)*3)
6030 RETURN
6100 IFW=1THEN7100
6110 IFHD<=30000ANDHD>19000THEN7110
6120 IFHD<=19000ANDHD>200THEN7120
6130 IFAS>150ANDHD>30000ANDHD<33965ANDFA>=15ANDU=-1ANDAG>=-1ANDAG<=4THEN7130
6135 IFAS<150ANDHD>30000ANDHD<33965ANDFA>=15ANDU=-1ANDAG>=-1ANDAG<=4THEN7135
6140 IFHD>30000ANDHD<33965ANDU=1THEN7140
6145 FORD=1TO1000:NEXT
6150 GOSUB8000:PRINT"I THINK YOU COULD DO BETTER - TRY AGAIN!":GOTO13000
7000 R=RND(TI):IFR>.5THEN7103
7100 GOSUB8000:PRINT" NEWS HEADLINES:[146] SUICIDAL PILOT HEADS"
7102 PRINT"TO THE CENTRE OF THE EARTH!":GOTO13000
7104 PRINT"TO COPY METEORITE":GOTO13000
7105 GOSUB8000:PRINT"YOU'VE OVERSHOT THE RUNWAY AND YOU'RE"
7106 PRINT"FLIGHT CREW WISH TO RESIGN.":GOTO13000
7110 GOSUB8000:PRINT"WELL IT WAS A BIT FOGGY WASN'T IT !!!":GOTO13000
7120 GOSUB8000:PRINT" DIGGING FOR OIL ARE WE???":GOTO13000
7125 GOSUB8000:PRINT" I SUPPOSE YOU THINK THAT'S A VERY"
7126 PRINT" YOU MADE IT (JUST).":GOTO13000
7130 GOSUB8000:PRINT"IT'S A GOOD JOB THE TOWER WAS IN"
7131 PRINT"THE WAY TO SLOW YOU DOWN--YOU CAME IN"
7132 PRINT"AT"AS"MILES PER HOUR!":GOTO13000
7135 GOSUB8000:PRINT" CONGRATULATIONS "
7140 GOSUB8000:PRINT"THANK YOU FOR SAVING THE USE OF THE"
7141 PRINT"UNDERCARRIAGE, BUT THE BOTTOM HALF OF THE"
7142 PRINT"THE PLANE SEEMS TO BE MISSING!!":GOT013000
8000 PRINT"";:FORI=1TO200:PRINT" ",:NEXT
8001 PRINT"";:RETURN
10000 GOSUB12000
10015 PRINT"IN THIS GAME YOU HAVE TO LAND AN"
10020 PRINT"AEROPLANE WHICH YOU CONTROL FROM THE"
10025 PRINT"GROUND."
10030 PRINT"YOU CAN SEE THE PLANE ON A RADAR"
10035 PRINT"SCREEN WHICH HAS A PATH PLOTTED ON IT."
10040 PRINT"THE NECESSARY INSTRUMENTS WILL APPEAR"
10045 PRINT"ON THE BOTTOM HALF OF THE SCREEN."
10050 GOSUB11000
10060 PRINT" THE CONTROLS "
10065 PRINT" [163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
10070 PRINT"THE '+[146]' KEY INCREASES RATE OF CLIMB."
10075 PRINT"THE '-[146]' KEY DECREASES RATE OF CLIMB."
10080 PRINT"THE '=[146]' KEY HOLDS THE RATE OF CLIMB."
10085 PRINT"THE 'I[146]' KEY INCREASES THE ENGINE REVS."
10090 PRINT"THE 'D[146]' KEY DECRAESES THE ENGINE REVS."
10095 PRINT"THE 'H[146]' KEY HOLDS THE SAME ENGINE REVS."
10100 GOSUB11000
10110 PRINT"THE 'U[146]' KEY OPERATES THE UNDERCARRIAGE."
10115 PRINT"THE 'A[146]' KEY OPERATES THE AIR BRAKES."
10117 PRINT"THE KEYS '0,1,2,3,4,5,6,7[146]' OPERATES,"
10118 PRINT"THE FLAPS AT FIVE DEGREE INTERVALS."
10290 PRINT" GENERAL INFORMATION "
10295 PRINT" [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
10300 PRINT"TO PLAY THIS GAME IT WOULD BE BEST IF";
10305 PRINT"YOU KNOW THAT, TO LAND THE AEROPLANE AT"
10310 PRINT"LEAST 15 DEGREES OF FLAP SHOULD BE ON"
10315 PRINT"AT TOUCHDOWN."
10318 GOSUB11000
10320 PRINT" AEROPLANE DESIGN LIMITS [146]"
10325 PRINT"STALLING SPEEDS"
10326 PRINT"92 MPH WITH FLAPS & LANDING GEAR DOWN."
10330 PRINT"110 MPH WITHOUT FLAPS."
10335 PRINT"MAXIMUM AIR SPEED IS 250 MPH."
10340 PRINT"MAXIMUM LANDING SPEED IS 150 MPH."
10345 PRINT"MAXIMUM AIR SPEED WITH FLAPS IS 185 MPH."
10348 PRINT"YOU WILL GET A WARNING INDICATOR IF YOU"
10349 PRINT"EXCEED THESE LIMITS."
10350 GOSUB11000
10380 PRINT"IF YOU WANT TO GO OVER THESE"
10382 FORI=1TO11:GETR$:NEXT
10385 PRINT"INSTRUCTIONS AGAIN PRESS 'A' ,IF"
10386 PRINT"NOT THEN PRESS ANY OTHER KEY."
10390 PRINT"HAPPY LANDINGS!":FORI=1TO500:GETR$:NEXT
10391 GETR$:IFR$=""THEN10391
10392 IFR$="A"THEN10000
10395 PRINT"[147]":RETURN
11000 PRINT"PRESS SPACE-BAR TO CONTINUE."
11005 FORI=1TO1000:GETR$:NEXT
11010 GETR$:IFR$=""THEN11010
12000 PRINT"[147] [185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
12005 PRINT" AIRCRAFT LANDER [146]"
12010 PRINT" [185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][146]"
12015 RETURN
13000 FORI=1TO2000:NEXT:GOSUB8000:PRINT"PRESS SPACE-BAR TO CONTINUE."
13010 GETR$:IFR$=""THEN13010
13015 FORI=1TO10:GETR$:NEXT
13020 CLR:QT=1:GOTO5